#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:Dog.py
# author:张世航
# datetime:2024/11/12 23:55
# software: PyCharm
"""
this is function  description 
"""
# import module your need

# Dog.py

class Dog:
    def __init__(self, name):
        self.name = name
        self.health = 80
        self.attack_power = 15

    def attack(self, human):
        if self.health <= 0:
            print(f"{self.name} is dead and cannot attack.")
            return

        human.take_damage(self.attack_power)
        self.attack_power = max(self.attack_power - 3, 0)  # Reduce attack power when attacking
        print(f"{self.name} bites {human.name} for {self.attack_power} damage.")

    def take_damage(self, damage):
        self.health -= damage
        if self.health < 0:
            self.health = 0
        print(f"{self.name} takes {damage} damage and now has {self.health} health.")

    def is_alive(self):
        return self.health > 0